//
//  TestImageView.m
//  sandbox
//
//  Created by 杨岑 on 1/5/15.
//  Copyright (c) 2015 杨岑. All rights reserved.
//

#import "TestImageView.h"

@implementation TestImageView

- (void)updateTrackingAreas
{
    for (NSTrackingArea* a in self.trackingAreas)
    {
        [self removeTrackingArea:a];
    }
    
    /*NSTrackingArea* trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds]
                                                                options:NSTrackingMouseMoved + NSTrackingActiveInKeyWindow+NSTrackingMouseEnteredAndExited
                                                                  owner:self
                                                               userInfo:nil];
    [self addTrackingArea:trackingArea];*/
}

- (void)mouseMoved:(NSEvent *)theEvent
{
    
}

- (void)mouseUp:(NSEvent *)theEvent{
    NSLog(@"%@: mouseUp", self);
}

- (void)scrollWheel:(NSEvent *)theEvent
{
    NSLog(@"%@: %@", self, theEvent);
}

- (void)resetCursorRects
{
    NSCursor* cursor = [NSCursor openHandCursor];
    [self addCursorRect:self.bounds cursor:cursor];
    //[cursor setOnMouseEntered:YES];
    //[cursor setOnMouseExited:YES];
}

@end
